﻿using System;
using System.Web;

namespace Common
{
	/// <summary>
	/// Lấy thông tin từ Session.
	/// </summary>
	public class ParameterSession : ParameterBase
	{
		#region Constructors
		public ParameterSession() : base() {}		
		public ParameterSession(string Url) : base(Url) {}
		#endregion
        
		#region Properties
		public override string this[string name]
		{
            
			get
			{
				if (HttpContext.Current != null)
					return HttpContext.Current.Session[name].ToString();
				else
					return null;
			}
			set
			{

				if (HttpContext.Current != null)
					HttpContext.Current.Session[name] = value;
			}
		}

		public override System.Collections.ICollection Keys
		{
			get
			{
				if (HttpContext.Current != null)
					return HttpContext.Current.Session.Keys;
				else
					return null;
			}
		}

		#endregion
	}
}
